﻿using DBProject2.Model;
using System;
using System.Windows.Media;

namespace DBProject2.ViewModel
{
		public class ContactViewModel : ObservableObject
    {
        #region [ Members ]

        private Contact vm_contact;

        #endregion [ Members ]

        #region [ Properties ]

        public string FirstName
        {
            get
            {
                return vm_contact.FirstName;
            }
            set
            {
                if (vm_contact.FirstName != value)
                {
                    vm_contact.FirstName = value;
                    RaisePropertyChanged("FirstName");
                }
            }
        }

        public string LastName
        {
            get
            {
                return vm_contact.LastName;
            }
            set
            {
                if (vm_contact.LastName != value)
                {
                    vm_contact.LastName = value;
                    RaisePropertyChanged("LastName");
                }
            }
        }

		public Nullable<byte> Age
        {
            get
            {
                return vm_contact.Age;
            }
            set
            {
                if (vm_contact.Age != value)
                {
                    vm_contact.Age = value;
                    RaisePropertyChanged("Age");
                }
            }
        }

        public string Email
        {
            get
            {
                return vm_contact.Email;
            }
            set
            {
                if (vm_contact.Email != value)
                {
                    vm_contact.Email = value;
                    RaisePropertyChanged("Email");
                }
            }
        }

								public Nullable<UInt32> PhoneNumber
        {
            get
            {
                return vm_contact.PhoneNumber;
            }
            set
            {
                if (vm_contact.PhoneNumber != value)
                {
                    vm_contact.PhoneNumber = value;
                    RaisePropertyChanged("PhoneNumber");
                }
            }
        }

        #endregion [ Properties ]

        #region [ Construction ]
        /// <summary>
        /// Constructs the default instance of a ContactViewModel
        /// </summary>
        public ContactViewModel()
        {
            vm_contact = new Contact();
        }

        #endregion [ Construction ]

    }
}